package route

import (
	"github.com/gin-gonic/gin"
	"github.com/vueadmin/app/api/internal/handler/membe"
	"github.com/vueadmin/app/api/internal/svc"
	"github.com/vueadmin/middleware"
	"github.com/vueadmin/utils/conv"
)

type Membe struct{}

/**
 * @description(会员管理路由)
 * @buildcode(true)
*/
func (Membe) RegisterRoute(route *gin.Engine, svcCtx *svc.ServiceContext) {
	r := route.Group(svcCtx.Config.Prefix)
	r.POST("/Membe/index", func(c *gin.Context) {membe.GetPageList(c, svcCtx)})               //数据列表
	r.POST("/Membe/update" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {membe.Update(c, svcCtx)})               //修改
	r.POST("/Membe/delete", func(c *gin.Context) {membe.Delete(c, svcCtx)})               //删除
	r.POST("/Membe/detail" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {membe.Detail(c, svcCtx)})               //查看详情
	r.POST("/Membe/resetPwd" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {membe.ResetPwd(c, svcCtx)})               //重置密码
	r.POST("/Membe/login", func(c *gin.Context) {membe.Login(c, svcCtx)})               //用户登录
	r.POST("/Membe/loginsms" ,middleware.SmsVerifyMiddleware(svcCtx.Redis), func(c *gin.Context) {membe.Loginsms(c, svcCtx)})               //短信验证码登录
	r.POST("/Membe/sendSms" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {membe.SendSms(c, svcCtx)})               //发送验证码
}

